
import 'package:flutter/material.dart';

///
/// center_demo2.dart
///

void main() => runApp(const MaterialApp(home:DemoCenterWidget2()));

class DemoCenterWidget2 extends StatelessWidget {
  const DemoCenterWidget2({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('ch14 center demo 2')),
      body: Container(
        padding: const EdgeInsets.all(18.0),
        margin: const EdgeInsets.all(44.0),
        width: 180.0,
        height: 240.0,
        decoration: BoxDecoration(
          color: Colors.red,
          borderRadius: BorderRadius.circular(10.0)
        ),
        child: const Center(
          child: Text(
            'Container（容器）在UI框架中是一个很常见的概念，Flutter也不例外。',
            style: TextStyle(fontSize: 20.0),
          ),
        ),
      ),
    );
  }
}
